package com.bbznb.controller;

import com.bbznb.config.AIservice;
import com.bbznb.entity.Message;
import dev.langchain4j.service.spring.AiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;

@RestController
@RequestMapping("/api/ai/chat")
public class Aimessage {
    @Autowired
    private AIservice aiService;
    @PostMapping(value = "")
    public Flux<String> aimessage(@RequestBody Message message) {
        System.out.println(message.getMessage());
        return aiService.getChatModels(message.getMessage());
    }
}
